package com.lagou.edu.springbootrabbit.controller;

import com.lagou.edu.springbootrabbit.service.RabbitService;
import com.lagou.edu.springbootrabbit.vo.OrderPayRespVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/order")
public class RabbitController {

    @Autowired
    private RabbitService rabbitService;

    @PostMapping("/createOrder")
    public Boolean addCache(String orderName,String userId){
        return rabbitService.createOrder(orderName,userId);
    }

    @PostMapping("/payOrder")
    public OrderPayRespVo getCache(String orderId,String userId) {
        return rabbitService.payOrder(orderId,userId);
    }

}
